package Test_0521;

/**
 * Created with Intellij IDEA
 * Description:
 * User: 星辰
 * Dare: 2024-05-21
 * Time: 23:42
 */
public class test {
    public static void main(String[] args) {
        final int a=1;
    }
    public static void main3(String[] args) {
        double a=1.0;
        double b=2.0;
        System.out.println(a%b);
        System.out.println(a%0);
        System.out.println(a/0);
    }
    public static void main2(String[] args) {
        String s="123";
        String b="abc";
        //字符串运算:只能相加不能进行其他运算
        //相加：字符串连接
        String j=s+b;
        System.out.println(s+b);//123abc
        System.out.println(j);//123abc

        //字符串的转型
        int a=Integer.parseInt(s);//123 将字符串转为整形
        //int c=Integer.parseInt(b); 不可以这样转换 字符串内容不为数字时，无法将字符串转为整形
        float d=Float.parseFloat(s);//123.0 将字符串转为浮点型
        System.out.println(a);
        System.out.println(d);

    }
    public static void main1(String[] args) {
        char a='1';
        char b='2';
        int h=a+b;
        int k=(char)(a+b);
        System.out.println(a+b);//99
        System.out.println(h);//99
        System.out.println(k);//99
        char q='a';
        char t='b';
        int y=q+t;
        int x=(char)(q+t);
        System.out.println(q+t);//195
        System.out.println(y);//195
        System.out.println(x);//195
        char j='啊';
        char s='哦';
        System.out.println(j+s);//43568
    }
}
